package com.ycg.store.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycg.store.common.Result;
import com.ycg.store.pojo.Warehouse;
import com.ycg.store.pojo.WarehouseType;
import com.ycg.store.service.WarehouseTypeService;
import com.ycg.store.mapper.WarehouseTypeMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author lenovo
* @description 针对表【warehouse_type(仓库类型表)】的数据库操作Service实现
* @createDate 2024-05-24 20:04:33
*/
@Service
public class WarehouseTypeServiceImpl extends ServiceImpl<WarehouseTypeMapper, WarehouseType>
    implements WarehouseTypeService{

    /**
     * 根据租户id获取仓库类型
     *
     * @param id 租户id
     * @return List<Warehouse>
     */
    @Override
    public Result<List<WarehouseType>> getByTenantId(String id) {
        LambdaQueryWrapper<WarehouseType> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(WarehouseType::getTenantId,id);
        List<WarehouseType> list = list(wrapper);
        return Result.ok(list);
    }
}




